package operation;

import book.BookList;

public class ExitOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        System.out.println("退出操作");

        int countnums = bookList.getBookNums();
        //让里面的内容都置为null
        for (int i = 0; i < countnums; i++) {
            bookList.setBook(null,i);
        }
        //数组大小变为1
        bookList.setBookNums(0);

        System.exit(0);
    }
}
